﻿using Comain.Orders;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IService.Rempos
{
    public class OrderDTO
    {
        /// <summary>
        /// 雪花编号
        /// </summary>
        [Key]
        public string Order_SnowId { get; set; }

        /// <summary>
        /// 订单来源(APP、电脑端、前台登记)
        /// </summary>
        [StringLength(30)]
        public string Order_From { get; set; } = string.Empty;

        /// <summary>
        /// 入住人
        /// </summary>
        [StringLength(30)]
        public string? Order_UserName { get; set; }

        /// <summary>
        /// 入住手机号
        /// </summary>
        [StringLength(11)]
        public string? Order_UserPhone { get; set; }

        /// <summary>
        /// 入住时间
        /// </summary>
        public DateTime Order_InTime { get; set; }

        /// <summary>
        /// 离店时间
        /// </summary>
        public DateTime Order_OutTime { get; set; }

        /// <summary>
        /// 入住人备注信息
        /// </summary>
        [StringLength(200)]
        public string? Order_Desc { get; set; }

        /// <summary>
        /// 入住金额
        /// </summary>
        public decimal? Order_Money { get; set; }

        /// <summary>
        /// 房间编号
        /// </summary>
        public string? Order_RoomNum { get; set; }

        /// <summary>
        /// 房客ID
        /// </summary>
        public string? Order_UserId { get; set; }

        /// <summary>
        /// 订单状态
        /// </summary>
        public OrderStateEnum Order_State { get; set; }

        /// <summary>
        /// 订单是否删除(false"未删除"，true"已删除")
        /// </summary>
        public bool Order_IsDel { get; set; } = false;


        public string ChangeOrder_State
        {
            get
            {
                if (Order_State == OrderStateEnum.预定)
                {
                    return "预定";
                }
                if (Order_State == OrderStateEnum.入住)
                {
                    return "入住";
                }
                if (Order_State == OrderStateEnum.取消预定)
                {
                    return "取消预定";
                }
                if (Order_State == OrderStateEnum.已退款)
                {
                    return "已退款";
                }
                if (Order_State == OrderStateEnum.已结算)
                {
                    return "已结算";
                }
                if (Order_State == OrderStateEnum.超时未入住)
                {
                    return "超时未入住";
                }
                else
                {
                    return "已退款";
                }
            }
        }

    }
}

